![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
@devtools-ds/object-parser
Advanced tools
Object parser is a utility used by the the `Object Inspector` package, which creates a JSON tree structure with node types that help simplify the JavaScript type system. It also uses TypeScript to make logic around using the tree strongly typed.
Object parser is a utility used by the the Object Inspector
package, which creates a JSON tree structure with node types that help simplify the JavaScript type system. It also uses TypeScript to make logic around using the tree strongly typed.
If you plan on using this, I recommend looking at the type definitions for the best description of how it formats.
The current supported types are:
export type SupportedTypes =
| boolean
| null
| number
| string
| Error
| symbol
| undefined
| Date
| RegExp
| object
| Map<any, any>
| WeakMap<any, any>
| Set<any>
| WeakSet<any>
| Promise<any>
| any[]
| Function;
npm i @devtools-ds/object-parser
# or with yarn
yarn add @devtools-ds/object-parser
import parse from "@devtools-ds/object-parser";
const data = { foo: "bar" };
const sortKeys = true;
const result = await parse(data, sortKeys);
Unfortunately, the parser has to be asynchronous in order to support Promises. From what I can find, there is no good way to inspect a promise synchronously. In the browser devtools they have access to the full Javascript engine.
This parser is in service to building a UI, which needs to be responsive. In deeply nested objects, we want to avoid having to parse everything before we can render the top node. To stop this, the parser only evaluates the current node, and then returns functions so that you can get the children on demand. For example, when you are expanding a tree view.
FAQs
Object parser is a utility used by the the `Object Inspector` package, which creates a JSON tree structure with node types that help simplify the JavaScript type system. It also uses TypeScript to make logic around using the tree strongly typed.
The npm package @devtools-ds/object-parser receives a total of 241,613 weekly downloads. As such, @devtools-ds/object-parser popularity was classified as popular.
We found that @devtools-ds/object-parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.